<extend name="Public:base"/>

<block name="main">

<load href="__PUBLIC__/js/swfupload.js"/>

<div id="yzh-content" class="col-xs-12">
    <div class="main-title">
        <h2>信息管理</h2>
    </div>

    <form id="myform" class="form-horizontal" name="myform" method="post" action="{:U('Block/edit')}">
        <div class="form-group">
            <label class="control-label col-md-2">名称:</label>
            <div class="col-md-8">
                <input type="text" class="form-control" name="name" id="name" value="{$vo.name}" readonly="readonly">
            </div>
        </div>
        <div class="form-group env-class">
            <label class="control-label col-md-2">pos:</label>
            <div class="col-md-8">
                <input type="text" class="form-control" name="pos" id="pos" value="{$vo.pos}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-2">内容:</label>
            <div class="col-md-8">
                {: $Form->editor(array('field'=>'content','moduleid'=>'231','setup'=>array('toolbar'=>'full','flashupload'=>'1')),$vo[content])}
            </div>
        </div>
        <div class="form-actions">
            <input type="hidden" name="id" value="{$vo.id}">
            <input type="submit" value="{:L('dosubmit')}" class="btn btn-sm btn-primary" />
            <input type="hidden" name="forward" value="/?a=edit&m=block&g=admin&id={$vo.id}&pos={$vo.pos}" />
            <input type="reset" value="{:L('reset')}" class="btn btn-sm btn-primary"/>
        </div>
    </form>

</div>

<script type="text/javascript">
$(document).ready(function() {
    $('#myform').ajaxForm({
        success:  complete,  // post-submit callback
        dataType: 'json'
    });
});

function complete(data){
    if(data.status==1){
        $.scojs_message('修改成功', $.scojs_message.TYPE_OK);

    }else{
        $.scojs_message(data.info, $.scojs_message.TYPE_ERROR);
    }

}
</script>
</block>